import { reactive } from 'vue'

let source = reactive({})
source.value = new ol.source.Vector() //图层数据源
var vector = new ol.layer.Vector({
  source: source.value,
  style: new ol.style.Style({
    //图层样式
    fill: new ol.style.Fill({
      color: 'rgba(255, 255, 255, 0.2)', //填充颜色
    }),
    stroke: new ol.style.Stroke({
      color: '#ffcc33', //边框颜色
      width: 2, // 边框宽度
    }),
    image: new ol.style.Circle({
      radius: 7,
      fill: new ol.style.Fill({
        color: '#ffcc33',
      }),
    }),
  }),
})

export { source, vector }
